package com.example.newsclient.controller;

import javax.annotation.Resource;

import com.example.newsclient.dao.News;
import com.example.newsclient.mapper.NewsMapper;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class NewsIdController {
    @Resource
    private NewsMapper newsMapper;
    @ResponseBody
    @RequestMapping("{user_id}")
    public News getNewsByUserId(@PathVariable String user_id){
        return newsMapper.getNewsByUserId(user_id);
    }
}
